package com.frank.loadinglibrary.special;

import com.frank.loadinglibrary.common.BaseLoadingComponent;
import com.frank.loadinglibrary.utils.Indicator;
import ohos.agp.components.AttrSet;
import ohos.agp.components.Component;
import ohos.app.Context;

public class WaveLoadingComponent extends BaseLoadingComponent {


    private Indicator indicator;

    public WaveLoadingComponent(Context context) {
        super(context);
    }

    public WaveLoadingComponent(Context context, AttrSet attrSet) {
        super(context, attrSet);
    }

    public WaveLoadingComponent(Context context, AttrSet attrSet, String styleName) {
        super(context, attrSet, styleName);
    }

    public WaveLoadingComponent(Context context, AttrSet attrSet, int resId) {
        super(context, attrSet, resId);
    }

    @Override
    protected void stopAnimators() {
        if (indicator != null && indicator.isRunning()) {
            indicator.stop();
        }
    }

    @Override
    protected void startAnimators() {
        if (indicator != null && !indicator.isRunning()) {
            indicator.start();
        }
    }
}
